#include "CardTypeData.h"
#include "CardType.h"

CardTypeData::CardTypeData()
: type(CardType::HighCard)
, first(0)
, second(0)
, third(0)
, fourth(0)
, fifth(0) {
}

bool CardTypeData::operator<(const CardTypeData & data) const {
  if (this->type < data.type) {
    return true;
  } else if (this->type == data.type) {
    if (this->first < data.first) {
      return true;
    } else if (this->first == data.first) {
      if (this->second < data.second) {
        return true;
      } else if (this->second == data.second) {
        if (this->third < data.third) {
          return true;
        } else if (this->third == data.third) {
          if (this->fourth < data.fourth) {
            return true;
          } else if (this->fourth == data.fourth) {
            if (this->fifth < data.fifth)
              return true;
          }
        }
      }
    }
  }
  return false;
}

bool CardTypeData::operator>(const CardTypeData & data) const {
  if (this->type > data.type) {
    return true;
  } else if (this->type == data.type) {
    if (this->first > data.first) {
      return true;
    } else if (this->first == data.first) {
      if (this->second > data.second) {
        return true;
      } else if (this->second == data.second) {
        if (this->third > data.third) {
          return true;
        } else if (this->third == data.third) {
          if (this->fourth > data.fourth) {
            return true;
          } else if (this->fourth == data.fourth) {
            if (this->fifth > data.fifth)
              return true;
          }
        }
      }
    }
  }
  return false;
}

bool CardTypeData::operator==(const CardTypeData & data) const {
  return this->type == data.type
          && this->first == data.first
          && this->second == data.second
          && this->third == data.third
          && this->fourth == data.fourth
          && this->fifth == data.fifth;
}

bool CardTypeData::operator!=(const CardTypeData & data) const {
  return this->type != data.type
          || this->first != data.first
          || this->second != data.second
          || this->third != data.third
          || this->fourth != data.fourth
          || this->fifth != data.fifth;
}
